package com.cloudjan.gmall.controller;

import java.util.List;
import com.cloudjan.gmall.bean.UserAddress;
import com.cloudjan.gmall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
	
	@Autowired
	OrderService orderService;
	
	@GetMapping("/initOrder")
	public List<UserAddress> initOrder(@RequestParam("uid")String userId) {
		System.out.println("订单初始化开始。。。。。");
		return orderService.initOrder(userId);
	}

	@GetMapping("/hello")
	public String hello(String name) {
		System.out.println("testing。。。。");
		return "hello "+name;
	}

}
